<template>
	<view>
		<view class="colonn">
			
			<view class="roww rowsa" >
				<view @click.stop="moniLogin(1)">区域经理</view>
				<view @click.stop="moniLogin(2)">店长</view>
				<view @click.stop="moniLogin(3)" >店员</view>
			</view>
			
			<picker
				:range="ckList" range-key="warehouse_name"
				@change="ckChange"
			>
				<view class="roww p-all-25 border_bottom">
					<view v-if="ckSel.warehouse_name">{{ckSel.warehouse_name}}</view>
					<view v-else>请选择门店</view>
					<view class="allline"></view>
					<view>点击选择</view>  
				</view>
			</picker>
			
			
			
			<block v-if="daipdOrder&&daipdOrder.length>0">
				<view v-for="(item,index) in daipdOrder"
				@click.stop="toScanPd(item)"
				>
					<view class="roww p-all-25">
						<view>盘点中的订单：{{item['pd_no']}}，</view>
						<view class="allline1"></view>
						<view>点击盘点</view>
					</view>
				</view>
			</block>
			<block v-else>
				<view class="roww pdbtn11 center_center ">
					<view @click.stop="createPdOrder">全盘盘点</view>
				</view>
			</block>
			
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello',
				warehouseId:"1970325698298316032",
				daipdOrder:[],
				ckList:[],
				ckSel:{}
			}
		},
		onLoad() {
			
			var selCk=uni.getStorageSync("selCk")
			if(selCk){
				this.ckSel=selCk;
				this.getNoPdOrder();
			}
			
			this.getCangku()
			
			
			
		},
		methods: {
			ckChange(res){
				this.ckSel=this.ckList[parseInt(res.detail.value)]
				uni.setStorageSync("selCk",this.ckSel)
				this.getNoPdOrder();
			},
			getCangku() {
				var data = {
				}
				this.$axios
					.axios('post', this.$paths.getCangkuPost, data)
					.then((res) => {
						var ckList=res.data;
						var aaList=[];
						for(var a=0;a<ckList.length;a++){
							if(ckList[a].warehouse_name.indexOf('最西域新疆特产-')>=0){
								aaList.push(ckList[a]);
							}
						}
						this.ckList=aaList;
						console.log("asd",this.ckList)
					})
					.catch((err) => {
						console.log('错误回调', err);
					});
			},
			toScanPd(item){
				uni.setStorageSync("pdOrder",item);
				uni.navigateTo({
					url:"/pages/scanGood/scanGood"
				})
			},
			getNoPdOrder(){
				var data = {
					'warehouseId':this.ckSel.warehouse_id
				}
				this.$axios
					.axios('post', this.$paths.getNoPdOrder, data)
					.then((res) => {
						console.log("订单猎豹",res);
						this.daipdOrder=res.data;
					})
					.catch((err) => {
						console.log('错误回调', err);
					});
			},
			
			createPdOrder(){
				var data = {
					'warehouseId':this.ckSel.warehouse_id
				}
				this.$axios
					.axios('post', this.$paths.createPdOrder, data)
					.then((res) => {
						
					})
					.catch((err) => {
						console.log('错误回调', err);
					});
			},
			
			
			
			
			
			
			
			moniLogin(index) {
				var dy = {
					"msg": "操作成功",
					"code": 200,
					"data": "操作成功",
					"corpInfo": {
						"corpId": "ww89944e61e3e02d29",
						"corpName": "新疆最西域电子商务有限公司",
						"agentId": "1000015",
						"appId": null,
						"secret": null
					},
					"permissions": [],
					"roles": ["ORDINARY_MEMBER"],
					"user": {
						"searchValue": null,
						"createBy": "超管",
						"createById": null,
						"createTime": "2025-03-03 11:49:48",
						"updateBy": "超管",
						"updateById": null,
						"updateTime": "2025-03-19 16:43:33",
						"remark": null,
						"params": {},
						"userId": "231",
						"weUserId": "ZXYMD0078",
						"deptId": "134",
						"deptName": "八楼店（二区）",
						"dept": {
							"searchValue": null,
							"createBy": null,
							"createById": null,
							"createTime": null,
							"updateBy": null,
							"updateById": null,
							"updateTime": null,
							"remark": null,
							"params": {},
							"deptId": "134",
							"parentId": null,
							"ancestors": null,
							"deptName": null,
							"deptEnName": null,
							"orderNum": null,
							"leader": "ZXYMD001",
							"phone": null,
							"email": null,
							"status": null,
							"delFlag": null,
							"parentName": null,
							"children": []
						},
						"userName": "其娜尔",
						"userDepts": null,
						"position": "店员",
						"phoneNumber": "",
						"sex": "0",
						"email": "",
						"bizMail": null,
						"leader": "ZXYMD001",
						"avatar": "",
						"thumbAvatar": null,
						"telephone": "",
						"nickName": "八楼店-其娜尔",
						"extAttr": "{\"attrs\":[]}",
						"weUserStatus": 1,
						"qrCode": null,
						"externalProfile": "{\"wechat_channels\":{\"nickname\":\"最西域特色新疆礼\",\"status\":0},\"external_attr\":[],\"external_corp_name\":\"\"}",
						"externalPosition": null,
						"address": null,
						"openUserid": null,
						"kfStatus": null,
						"dataScope": 5,
						"jobNumber": null,
						"userType": null,
						"isAllocate": null,
						"isUserLeave": null,
						"dimissionTime": null,
						"salt": null,
						"status": "0",
						"delFlag": 0,
						"loginIp": "",
						"loginDate": null,
						"isOpenChat": null,
						"roles": [{
							"searchValue": null,
							"createBy": null,
							"createById": null,
							"createTime": "2021-02-13 20:53:40",
							"updateBy": null,
							"updateById": null,
							"updateTime": null,
							"remark": "普通成员",
							"params": {},
							"roleId": "1",
							"roleName": "企微成员",
							"roleKey": "ORDINARY_MEMBER",
							"roleSort": "2",
							"dataScope": "5",
							"status": "0",
							"delFlag": "0",
							"menuIds": null,
							"deptIds": null,
							"baseRole": null,
							"users": null,
							"oldRoleId": null,
							"admin": false
						}],
						"roleIds": null,
						"roleId": null,
						"postIds": null,
						"companyName": "八楼店（二区）",
						"deptIds": "134",
						"openDaily": null,
						"checkIsRoot": false,
						"account": null,
						"defaultAccount": null,
						"admin": false
					},
					"configParamInfo": {
						"firstRegister": true,
						"weAppParamFill": false,
						"chatParamFill": false,
						"redEnvelopesParamFile": false
					}
				}
				var dz = {
					"msg": "操作成功",
					"code": 200,
					"data": "操作成功",
					"corpInfo": {
						"corpId": "ww89944e61e3e02d29",
						"corpName": "新疆最西域电子商务有限公司",
						"agentId": "1000015",
						"appId": null,
						"secret": null
					},
					"permissions": ["customerManage:customer:checkRepeat", "customerManage:dimission:filter",
						"/contentCenter/material/index", "contentCenter/corporateScripts/index",
						"/contentCenter/lexical/index", "customerManage:customer:edit",
						"customerManage/customer:makeTag", "contentCenter/corporateScripts/add",
						"customerManage:dimission/allocatedStaffDetail", "customerMessagePush:push:pushResults",
						"customerMessagePush:push:asyncResult", "customerManage:tag:add",
						"customerManage:dimission:allocate", "customerManage:group:sync",
						"customerManage:dimission:query", "customerManage:tag:sync", "customerManage:group:view",
						"/operateCenter/operateAnalysis/customerAnalysis", "customerManage:customerDetail:list",
						"customerManage:dimission:allocatedStaffList", "contentCenter/trackMaterial/articleAdd",
						"wecom:user:getAllocateGroups", "customerManage:customer:view",
						"customerManage:tag:remove",
						"contentCenter/basicMaterial/detail", "/contentCenter/trackMaterial/posterAdd",
						"contentCenter/trackMaterial/detail", "customerManage:customer:list",
						"customerManage:customer:sync", "customerManage:tag:list",
						"/operateCenter/operateAnalysis/groupAnalysis", "customerManage:customer:query",
						"customerManage:group:list", "customerManage:customer:removeTag",
						"customerManage:group:export",
						"/contentCenter/trackMaterial/index", "customerManage:customer:export",
						"customerManage:tag:edit", "customerManage:group:query", "drainageCode:group:baseInfo",
						"wecom:user:getAllocateCustomers", "contentCenter/corporateScripts/detail",
						"customerManage:dimission:edit"
					],
					"roles": ["11", "ORDINARY_MEMBER"],
					"user": {
						"searchValue": null,
						"createBy": "超管",
						"createById": null,
						"createTime": "2025-01-09 14:12:23",
						"updateBy": "超管",
						"updateById": null,
						"updateTime": "2025-03-19 16:43:21",
						"remark": null,
						"params": {},
						"userId": "53",
						"weUserId": "ZXYMD001",
						"deptId": "19",
						"deptName": "友好万科店(二区)",
						"dept": {
							"searchValue": null,
							"createBy": null,
							"createById": null,
							"createTime": null,
							"updateBy": null,
							"updateById": null,
							"updateTime": null,
							"remark": null,
							"params": {},
							"deptId": "19",
							"parentId": null,
							"ancestors": null,
							"deptName": null,
							"deptEnName": null,
							"orderNum": null,
							"leader": "ZXY094",
							"phone": null,
							"email": null,
							"status": null,
							"delFlag": null,
							"parentName": null,
							"children": []
						},
						"userName": "悠然",
						"userDepts": null,
						"position": "店长",
						"phoneNumber": "",
						"sex": "0",
						"email": "",
						"bizMail": "youhaowankedian-youran@zuixiyu.com",
						"leader": "ZXY094",
						"avatar": "https://wework.qpic.cn/wwpic3az/541045_cwJ6siuETg6lOde_1734532099/0",
						"thumbAvatar": null,
						"telephone": "",
						"nickName": "友好万科-悠然",
						"extAttr": "{\"attrs\":[]}",
						"weUserStatus": 1,
						"qrCode": "https://open.work.weixin.qq.com/wwopen/userQRCode?vcode=vccc93fb6546394e59",
						"externalProfile": "{\"wechat_channels\":{\"nickname\":\"最西域特色新疆礼\",\"status\":0},\"external_attr\":[{\"name\":\"点我购物\",\"type\":2,\"miniprogram\":{\"pagepath\":\"pages/new/home/index/index.html?scene=1970302379150869888\",\"appid\":\"wx89ed2d63769433ee\",\"title\":\"最西域特色新疆礼\"}}],\"external_corp_name\":\"\"}",
						"externalPosition": null,
						"address": "",
						"openUserid": null,
						"kfStatus": null,
						"dataScope": 1,
						"jobNumber": null,
						"userType": "03",
						"isAllocate": null,
						"isUserLeave": null,
						"dimissionTime": null,
						"salt": null,
						"status": "0",
						"delFlag": 0,
						"loginIp": "",
						"loginDate": null,
						"isOpenChat": null,
						"roles": [{
							"searchValue": null,
							"createBy": null,
							"createById": null,
							"createTime": "2021-02-13 20:53:40",
							"updateBy": null,
							"updateById": null,
							"updateTime": null,
							"remark": "普通成员",
							"params": {},
							"roleId": "1",
							"roleName": "企微成员",
							"roleKey": "ORDINARY_MEMBER",
							"roleSort": "2",
							"dataScope": "5",
							"status": "0",
							"delFlag": "0",
							"menuIds": null,
							"deptIds": null,
							"baseRole": null,
							"users": null,
							"oldRoleId": null,
							"admin": false
						}, {
							"searchValue": null,
							"createBy": null,
							"createById": null,
							"createTime": "2025-01-21 10:02:12",
							"updateBy": null,
							"updateById": null,
							"updateTime": null,
							"remark": null,
							"params": {},
							"roleId": "4",
							"roleName": "内容创作部",
							"roleKey": "11",
							"roleSort": "0",
							"dataScope": "1",
							"status": "0",
							"delFlag": "0",
							"menuIds": null,
							"deptIds": null,
							"baseRole": null,
							"users": null,
							"oldRoleId": null,
							"admin": false
						}],
						"roleIds": null,
						"roleId": null,
						"postIds": null,
						"companyName": "新疆最西域电子商务有限公司",
						"deptIds": "19,62",
						"openDaily": null,
						"checkIsRoot": false,
						"account": null,
						"defaultAccount": null,
						"admin": false
					},
					"configParamInfo": {
						"firstRegister": true,
						"weAppParamFill": false,
						"chatParamFill": false,
						"redEnvelopesParamFile": false
					}
				}
				var qyjl = {
					"msg": "操作成功",
					"code": 200,
					"data": "操作成功",
					"corpInfo": {
						"corpId": "ww89944e61e3e02d29",
						"corpName": "新疆最西域电子商务有限公司",
						"agentId": "1000015",
						"appId": null,
						"secret": null
					},
					"permissions": [],
					"roles": ["ORDINARY_MEMBER"],
					"user": {
						"searchValue": null,
						"createBy": "超管",
						"createById": null,
						"createTime": "2025-03-03 11:49:19",
						"updateBy": "超管",
						"updateById": null,
						"updateTime": "2025-03-19 16:43:22",
						"remark": null,
						"params": {},
						"userId": "228",
						"weUserId": "ZXY094",
						"deptId": "64",
						"deptName": "二区",
						"dept": {
							"searchValue": null,
							"createBy": null,
							"createById": null,
							"createTime": null,
							"updateBy": null,
							"updateById": null,
							"updateTime": null,
							"remark": null,
							"params": {},
							"deptId": "64",
							"parentId": null,
							"ancestors": null,
							"deptName": null,
							"deptEnName": null,
							"orderNum": null,
							"leader": "ZXY018",
							"phone": null,
							"email": null,
							"status": null,
							"delFlag": null,
							"parentName": null,
							"children": []
						},
						"userName": "高瑞",
						"userDepts": null,
						"position": "区域经理",
						"phoneNumber": "",
						"sex": "0",
						"email": "",
						"bizMail": null,
						"leader": "ZXY018",
						"avatar": "",
						"thumbAvatar": null,
						"telephone": "",
						"nickName": "瑞瑞",
						"extAttr": "{\"attrs\":[]}",
						"weUserStatus": 1,
						"qrCode": null,
						"externalProfile": "{\"wechat_channels\":{\"nickname\":\"最西域特色新疆礼\",\"status\":0},\"external_attr\":[],\"external_corp_name\":\"\"}",
						"externalPosition": null,
						"address": null,
						"openUserid": null,
						"kfStatus": null,
						"dataScope": 5,
						"jobNumber": null,
						"userType": null,
						"isAllocate": null,
						"isUserLeave": null,
						"dimissionTime": null,
						"salt": null,
						"status": "0",
						"delFlag": 0,
						"loginIp": "",
						"loginDate": null,
						"isOpenChat": null,
						"roles": [{
							"searchValue": null,
							"createBy": null,
							"createById": null,
							"createTime": "2021-02-13 20:53:40",
							"updateBy": null,
							"updateById": null,
							"updateTime": null,
							"remark": "普通成员",
							"params": {},
							"roleId": "1",
							"roleName": "企微成员",
							"roleKey": "ORDINARY_MEMBER",
							"roleSort": "2",
							"dataScope": "5",
							"status": "0",
							"delFlag": "0",
							"menuIds": null,
							"deptIds": null,
							"baseRole": null,
							"users": null,
							"oldRoleId": null,
							"admin": false
						}],
						"roleIds": null,
						"roleId": null,
						"postIds": null,
						"companyName": "二区",
						"deptIds": "64",
						"openDaily": null,
						"checkIsRoot": false,
						"account": null,
						"defaultAccount": null,
						"admin": false
					},
					"configParamInfo": {
						"firstRegister": true,
						"weAppParamFill": false,
						"chatParamFill": false,
						"redEnvelopesParamFile": false
					}
				}
				if (index == 1) {
					uni.setStorageSync("userInfowx", (qyjl)); //区域经理
				} else if (index == 2) {
					uni.setStorageSync("userInfowx", (dz)); //店长
				} else if (index == 3) {
					uni.setStorageSync("userInfowx", (dy)); //店员
				}
			},
			
			
			
		}
	}
</script>

<style>
	@import url(index.css);
</style>
